gridpack::serial_io::SerialBranchIO< _network > Class Template Reference

#include <serial_io.hpp>

Collaboration diagram for gridpack::serial_io::SerialBranchIO< _network >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 SerialBranchIO (int max_str_len, boost::shared_ptr< _network > network)
 ~SerialBranchIO (void)
void open (const char *filename)
boost::shared_ptr< std::ofstream > getStream ()
void setStream (boost::shared_ptr< std::ofstream > stream)
void close ()
void write (const char *signal=NULL)
void header (const char *str)
template<class _data_type >
void gatherData (std::vector< _data_type > &data_vector, const char *signal=NULL)
std::vector< std::string > writeStrings (const char *signal=NULL)

template<class _network>
class gridpack::serial_io::SerialBranchIO< _network >


Constructor & Destructor Documentation

template<class _network >
gridpack::serial_io::SerialBranchIO< _network >::SerialBranchIO ( int  max_str_len,
boost::shared_ptr< _network >  network 
)

Simple constructor

Parameters:
max_str_len the maximum string length written out by any branch
network the network for which output is desired
template<class _network >
gridpack::serial_io::SerialBranchIO< _network >::~SerialBranchIO ( void   ) 

Member Function Documentation

template<class _network >
void gridpack::serial_io::SerialBranchIO< _network >::close (  ) 

Close file and redirect output to standard out

template<class _network >
template<class _data_type >
void gridpack::serial_io::SerialBranchIO< _network >::gatherData ( std::vector< _data_type > &  data_vector,
const char *  signal = NULL 
)

This is a function that can use the machinery that has been set up in the serialBranchIO class to move data to the head node

Parameters:
vector of data at the head node (this vector will be empty on all other nodes) character string that can be used to specify which data is being requested
template<class _network >
boost::shared_ptr<std::ofstream> gridpack::serial_io::SerialBranchIO< _network >::getStream (  ) 

return IO stream

Returns:
IO stream to file
template<class _network >
void gridpack::serial_io::SerialBranchIO< _network >::header ( const char *  str  ) 

Write single string to standard output. This is used to write headers for a data listing. It is mostly a convenience function so that users do not have to identify the head node

Parameters:
str character string containing the header
template<class _network >
void gridpack::serial_io::SerialBranchIO< _network >::open ( const char *  filename  ) 

Redirect output to a file instead of standard out

Parameters:
filename name of file that output goes to

References gridpack::serial_io::SerialBranchIO< _network >::close().

template<class _network >
void gridpack::serial_io::SerialBranchIO< _network >::setStream ( boost::shared_ptr< std::ofstream >  stream  ) 

Set IO stream to point to existing file

Parameters:
IO stream to file
template<class _network >
void gridpack::serial_io::SerialBranchIO< _network >::write ( const char *  signal = NULL  ) 

Write output from branches to standard out

Parameters:
signal an optional character string used to control contents of output
template<class _network >
std::vector<std::string> gridpack::serial_io::SerialBranchIO< _network >::writeStrings ( const char *  signal = NULL  ) 

Write output from branches to a vector of strings

Parameters:
signal an optional character string used to control contents of output
Returns:
a vector of strings contain output from branches

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 3 Feb 2020 for GridPACK by  doxygen 1.6.1